//
//  DKHomeHttp.m
//  DanKU
//
//  Created by 吴斌 on 2023/10/25.
//

#import "DKHomeHttp.h"

@implementation DKHomeHttp
//获取用户基本信息
+(void)apiGetUserBaseInfoForAPI:(NSDictionary *)param complete:(void(^)(void))complete{
    [[DKHttpHelper request] POST:[NSString getServiceUrl:DK_GetUserBaseInfo] params:param withJson:YES withIsLoad:NO success:^(NSInteger status, id  _Nonnull data) {
        if([[data objectForKey:@"code"] isEqualToString:@"200"]){
            NSDictionary *userBaseInfoDic = (NSDictionary *)[data objectForKey:@"data"];
            [DKGlobalHelper defaultManager].userBaseInfoMdl = [DKUserBaseInfoModel mj_objectWithKeyValues:userBaseInfoDic];
            complete();
        }
    }failure:^(NSInteger status, NSString * _Nonnull msg) {
        
    }];
}
//获取用户额度
+(void)apiGetUserCreditInfoForAPI:(NSDictionary *)param complete:(void(^)(void))complete{
    [[DKHttpHelper request] POST:[NSString getServiceUrl:DK_GetUserCreditInfo] params:param withJson:YES withIsLoad:NO success:^(NSInteger status, id  _Nonnull data) {
        if([[data objectForKey:@"code"] isEqualToString:@"200"]){
            NSDictionary *userBaseInfoDic = (NSDictionary *)[data objectForKey:@"data"];
            [DKGlobalHelper defaultManager].userComplaintMdl = [DKUserComplaintModel mj_objectWithKeyValues:userBaseInfoDic];
            complete();
        }
    }failure:^(NSInteger status, NSString * _Nonnull msg) {
        
    }];
}
@end
